import {RouterProvider} from 'react-router-dom'
import { createRoot } from 'react-dom/client'
import { Provider } from 'react-redux'
import { store } from './store/store'
import { checkAuthStatus } from './store/slices/authSlice'
import './index.css'
import router from './router'

// 在 store 创建后立即检查认证状态
store.dispatch(checkAuthStatus());

createRoot(document.getElementById('root')!).render(
  <Provider store={store}>
    <RouterProvider router={router} />
  </Provider>
)